<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <!-- 差值绑定 -->
    <!-- <p>{{name}}</p> -->
    <!-- 指令解析 -->
    <p m-text="name"></p>
    <p>{{age}}</p>
    <p>{{doubleAge}}</p>
    <input type="text" m-model="name" />
    <button @click="changename">呵呵</button>
    <div m-html="html"></div>
  </div>
  <script src="./compile.js"></script>
  <script src="./mvue.js"></script>

  <script>
    const kaikeba = new MVue({
      el: '#app',
      data: {
        name: '马少东',
        age: 12,
        doubleAge: 24,
        html: '<button>这是一个按钮</button>'
      },
      created() {
        // console.log('开始了');
        setTimeout(() => {
          this.name = '我改变了'
        }, 1500)
      },
      methods: {
        changename() {
          this.name = "哈喽，开课吧";
          this.age = 1
        }
      }
    })
  </script>
</body>

</html>